<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <script src="assets/js/echarts.min.js"></script>
    <link rel="stylesheet" href="assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="assets/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="assets/css/app.css">
    <script src="assets/js/jquery.min.js"></script>

<style type="text/css">
.image_sm{
    max-width: 100px;
    pading:5px;
}
</style>
</head>

<body data-type="widgets">
    <script src="assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        <!-- 头部 -->
        <header>
            <!-- logo -->
            <div class="am-fl tpl-header-logo">
                <a href="javascript:;"><img src="assets/img/logo.png" alt=""></a>
            </div>
            <!-- 右侧内容 -->
            <div class="tpl-header-fluid">
                <!-- 侧边切换 -->
                <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>

                </span>
                </div>
                <!-- 搜索 -->
                <div class="am-fl tpl-header-search">
                    <form class="tpl-header-search-form" action="javascript:;">
                        <button class="tpl-header-search-btn am-icon-search"></button>
                        <input class="tpl-header-search-box" type="text" placeholder="搜索内容...">
                    </form>
                </div>
                <!-- 其它功能-->
                <div class="am-fr tpl-header-navbar">
                    <ul>
                        <!-- 欢迎语 -->
                        <li class="am-text-sm tpl-header-navbar-welcome">
                            <a href="javascript:;">欢迎你, <span>Amaze UI</span> </a>
                        </li>

                        <!-- 新邮件 -->
                        <li class="am-dropdown tpl-dropdown" data-am-dropdown>
                            <a href="javascript:;" class="am-dropdown-toggle tpl-dropdown-toggle" data-am-dropdown-toggle>
                                <i class="am-icon-envelope"></i>
                                <span class="am-badge am-badge-success am-round item-feed-badge">4</span>
                            </a>
                            <!-- 弹出列表 -->
                            <ul class="am-dropdown-content tpl-dropdown-content">
                                <li class="tpl-dropdown-menu-messages">
                                    <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                        <div class="menu-messages-ico">
                                            <img src="assets/img/user04.png" alt="">
                                        </div>
                                        <div class="menu-messages-time">
                                            3小时前
                                        </div>
                                        <div class="menu-messages-content">
                                            <div class="menu-messages-content-title">
                                                <i class="am-icon-circle-o am-text-success"></i>
                                                <span>夕风色</span>
                                            </div>
                                            <div class="am-text-truncate"> Amaze UI 的诞生，依托于 GitHub 及其他技术社区上一些优秀的资源；Amaze UI 的成长，则离不开用户的支持。 </div>
                                            <div class="menu-messages-content-time">2016-09-21 下午 16:40</div>
                                        </div>
                                    </a>
                                </li>

                                <li class="tpl-dropdown-menu-messages">
                                    <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                        <div class="menu-messages-ico">
                                            <img src="assets/img/user02.png" alt="">
                                        </div>
                                        <div class="menu-messages-time">
                                            5天前
                                        </div>
                                        <div class="menu-messages-content">
                                            <div class="menu-messages-content-title">
                                                <i class="am-icon-circle-o am-text-warning"></i>
                                                <span>禁言小张</span>
                                            </div>
                                            <div class="am-text-truncate"> 为了能最准确的传达所描述的问题， 建议你在反馈时附上演示，方便我们理解。 </div>
                                            <div class="menu-messages-content-time">2016-09-16 上午 09:23</div>
                                        </div>
                                    </a>
                                </li>
                                <li class="tpl-dropdown-menu-messages">
                                    <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                        <i class="am-icon-circle-o"></i> 进入列表…
                                    </a>
                                </li>
                            </ul>
                        </li>

                        <!-- 新提示 -->
                        <li class="am-dropdown" data-am-dropdown>
                            <a href="javascript:;" class="am-dropdown-toggle" data-am-dropdown-toggle>
                                <i class="am-icon-bell"></i>
                                <span class="am-badge am-badge-warning am-round item-feed-badge">5</span>
                            </a>

                            <!-- 弹出列表 -->
                            <ul class="am-dropdown-content tpl-dropdown-content">
                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <div class="tpl-dropdown-menu-notifications-title">
                                            <i class="am-icon-line-chart"></i>
                                            <span> 有6笔新的销售订单</span>
                                        </div>
                                        <div class="tpl-dropdown-menu-notifications-time">
                                            12分钟前
                                        </div>
                                    </a>
                                </li>
                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <div class="tpl-dropdown-menu-notifications-title">
                                            <i class="am-icon-star"></i>
                                            <span> 有3个来自人事部的消息</span>
                                        </div>
                                        <div class="tpl-dropdown-menu-notifications-time">
                                            30分钟前
                                        </div>
                                    </a>
                                </li>
                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <div class="tpl-dropdown-menu-notifications-title">
                                            <i class="am-icon-folder-o"></i>
                                            <span> 上午开会记录存档</span>
                                        </div>
                                        <div class="tpl-dropdown-menu-notifications-time">
                                            1天前
                                        </div>
                                    </a>
                                </li>


                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <i class="am-icon-bell"></i> 进入列表…
                                    </a>
                                </li>
                            </ul>
                        </li>

                        <!-- 退出 -->
                        <li class="am-text-sm">
                            <a href="javascript:;">
                                <span class="am-icon-sign-out"></span> 退出
                            </a>
                        </li>
                    </ul>
                </div>
            </div>

        </header>
        <!-- 风格切换 -->
        <div class="tpl-skiner">
            <div class="tpl-skiner-toggle am-icon-cog">
            </div>
            <div class="tpl-skiner-content">
                <div class="tpl-skiner-content-title">
                    选择主题
                </div>
                <div class="tpl-skiner-content-bar">
                    <span class="skiner-color skiner-white" data-color="theme-white"></span>
                    <span class="skiner-color skiner-black" data-color="theme-black"></span>
                </div>
            </div>
        </div>
        <!-- 侧边导航栏 -->
        <div class="left-sidebar">
            <!-- 用户信息 -->
            <div class="tpl-sidebar-user-panel">
                <div class="tpl-user-panel-slide-toggleable">
                    <div class="tpl-user-panel-profile-picture">
                        <img src="assets/img/user04.png" alt="">
                    </div>
                    <span class="user-panel-logged-in-text">
              <i class="am-icon-circle-o am-text-success tpl-user-panel-status-icon"></i>
              禁言小张
          </span>
                    <a href="javascript:;" class="tpl-user-panel-action-link"> <span class="am-icon-pencil"></span> 账号设置</a>
                </div>
            </div>

            <!-- 菜单 -->
            <ul class="sidebar-nav">
                <li class="sidebar-nav-heading">Components <span class="sidebar-nav-heading-info"> 附加组件</span></li>
                <li class="sidebar-nav-link">
                    <a href="index.html">
                        <i class="am-icon-home sidebar-nav-link-logo"></i> 首页
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="tables.html">
                        <i class="am-icon-table sidebar-nav-link-logo"></i> 表格
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="calendar.html">
                        <i class="am-icon-calendar sidebar-nav-link-logo"></i> 日历
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="form.html">
                        <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 表单

                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="chart.html">
                        <i class="am-icon-bar-chart sidebar-nav-link-logo"></i> 图表

                    </a>
                </li>

                <li class="sidebar-nav-heading">Page<span class="sidebar-nav-heading-info"> 常用页面</span></li>
                <li class="sidebar-nav-link">
                    <a href="javascript:;" class="sidebar-nav-sub-title active">
                        <i class="am-icon-table sidebar-nav-link-logo"></i> 数据列表
                        <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico sidebar-nav-sub-ico-rotate"></span>
                    </a>
                    <ul class="sidebar-nav sidebar-nav-sub" style="display: block;">
                        <li class="sidebar-nav-link">
                            <a href="table-list.html" class="sub-active">
                                <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 文字列表
                            </a>
                        </li>

                        <li class="sidebar-nav-link">
                            <a href="table-list-img.html">
                                <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 图文列表
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="sidebar-nav-link">
                    <a href="sign-up.html">
                        <i class="am-icon-clone sidebar-nav-link-logo"></i> 注册
                        <span class="am-badge am-badge-secondary sidebar-nav-link-logo-ico am-round am-fr am-margin-right-sm">6</span>
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="login.html">
                        <i class="am-icon-key sidebar-nav-link-logo"></i> 登录
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="404.html">
                        <i class="am-icon-tv sidebar-nav-link-logo"></i> 404错误
                    </a>
                </li>

            </ul>
        </div>


        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-cf">文章列表</div>
                            </div>

                                <div class="widget-body  am-fr">

                                <!-- 编辑栏 -->
                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                    <div class="am-form-group">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>
                                                <button type="button" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-save"></span> 保存</button>
                                                <button type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span> 审核</button>
                                                <button type="button" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- 下拉框 -->
                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                                    <div class="am-form-group tpl-table-list-select">
                                        <select data-am-selected="{btnSize: 'sm'}">
                                          <option value="option1">所有类别</option>
                                          <option value="option2">IT业界</option>
                                          <option value="option3">数码产品</option>
                                          <option value="option3">笔记本电脑</option>
                                          <option value="option3">平板电脑</option>
                                          <option value="option3">只能手机</option>
                                          <option value="option3">超极本</option>
                                        </select>
                                    </div>
                                </div>
                                <!-- 搜索框 -->
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field ">
                                        <span class="am-input-group-btn">
                                            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="button"></button>
                                          </span>
                                    </div>
                                </div>
                                <!-- 表格显示 -->
                                <div class="am-u-sm-12">
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black " id="example-r">
                                        <thead>
                                            <tr>
                                                <th>分类名称</th>
                                                <th>商品编号</th>
                                                <th>成分</th>
                                                <th>商品功效</th>
                                                <th>商品用途</th>
                                                <th>商品说明</th>
                                                <th>商品图片</th>
                                                <th>进货价格</th>
                                                <th>售价</th>
                                                <th>库存</th>
                                                <th>计量方式</th>
                                                <th>操作zu</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr class="gradeX">
                                                <td>第一类</td>
                                                <td>001</td>
                                                <td>姜片</td>
                                                <td>驱寒</td>
                                                <td>吃</td>
                                                <td>吃的</td>
                                                <td>
                                                    <img src="" class="image_sm" id="oldImg" > 
                                                </td>
                                                <td>10</td>
                                                <td>15</td>
                                                <td>100</td>
                                                <td>克</td>
                                                <td>
                                                    <div class="tpl-table-black-operation">
                                                        <a href="javascript:;"  class="edit"  data-am-modal="{target: '#product_enter', closeViaDimmer: 0}">
                                                            <i class="am-icon-pencil"></i> 编辑
                                                        </a>
                                                        <a href="javascript:;" class="tpl-table-black-operation-del">
                                                            <i class="am-icon-trash"></i> 删除
                                                        </a>
                                                    </div>
                                                </td>
                                            </tr>

                                            <!-- more data -->
                                        </tbody>
                                    </table>
                                </div>
                                <div class="am-u-lg-12 am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

       <!-- 添加商品录入模态框开始 -->
        <div class="am-modal am-modal-no-btn" tabindex="-1" id="product_enter">
            <div class="am-modal-dialog" style="width: 900px;">
                <div class="am-modal-bd">
                    <div class="row">
                        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                            <div class="widget am-cf">
                                <div class="widget-head am-cf">
                                    <div class="widget-title am-fl">商品录入</div>
                                    <div class="widget-function am-fr">
                                        <a href="javascript: void(0)" class="am-close am-close-spin close_a" data-am-modal-close>&times;</a>
                                    </div>
                                </div>
                                <div class="widget-body am-fr">
                                    <form class="am-form tpl-form-border-form tpl-form-border-br">

                                        <!-- 分类名称 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">分类名称</label>
                                            <div class="am-u-sm-7"  />
                                                <select id="proType_id" data-am-selected="{searchBox: 0}" style="display: none;" required="required" >
                                                    <option value="1">第一类</option>
                                                    <option value="2">第二类</option>
                                                    <option value="3">第三类</option>
                                                </select>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 商品编号 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">商品编号</label>
                                            <div class="am-u-sm-7">
                                                <input type="text" id="product_no" class="am-form-field tpl-form-no-bg" placeholder="请输入商品编号，仅限数字"  required="required" onkeyup="this.value=this.value.replace(/\D/g,'')" onblur="this.value=this.value.replace(/\D/g,'')"/>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 商品成分-->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">成分</label>
                                            <div class="am-u-sm-7">
                                                <textarea id="ingre" class="am-form-field tpl-form-no-bg" placeholder="请输入商品成分，最多不超过200" maxlength="200" required="required"></textarea>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>  

                                        <!-- 商品功效-->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">商品功效</label>
                                            <div class="am-u-sm-7">
                                                <textarea id="proEffect" class="am-form-field tpl-form-no-bg" placeholder="请输入商品功效，最多不超过200" maxlength="200" required="required"></textarea>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 商品用途 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">商品用途</label>
                                            <div class="am-u-sm-7">
                                                <textarea id="useOf" class="am-form-field tpl-form-no-bg" placeholder="请输入商品用途，最多不超过200" maxlength="200" required="required"></textarea>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 商品说明 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">商品说明</label>
                                            <div class="am-u-sm-7">
                                                <textarea id="proInstruct" class="am-form-field tpl-form-no-bg" placeholder="请输入商品说明，最多不超过200" maxlength="200" ></textarea>
                                                
                                            </div>
                                            <div class="am-u-sm-2">
                                            </div>
                                        </div>

                                        <!-- 商品图片 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">商品图片</label>
                                            <div class="am-u-sm-7">
                                                <div class="am-form-group am-form-file">
                                                    <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                                        <i class="am-icon-cloud-upload"></i> 添加商品图片</button>
                                                    <input type="file" id="proPhoto">
                                                </div>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 进货价格 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">进货价格</label>
                                            <div class="am-u-sm-7">
                                                <input type="text" id="purchasePrice" class="am-form-field tpl-form-no-bg" placeholder="请输入进货价格，仅限于整数或小数"  required="required" onkeyup="onlyNumber(this)" onblur="onlyNumber(this)"/>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 售价 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">售价</label>
                                            <div class="am-u-sm-7">
                                                <input type="text" id="unitPrice" class="am-form-field tpl-form-no-bg" placeholder="请输入售价，仅限于整数或小数"  required="required" onkeyup="onlyNumber(this)" onblur="onlyNumber(this)"/>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 库存 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">库存</label>
                                            <div class="am-u-sm-7">
                                                <input type="text" id="proStock" class="am-form-field tpl-form-no-bg" placeholder="请输入库存，仅限数字"  required="required" onkeyup="this.value=this.value.replace(/\D/g,'')" onblur="this.value=this.value.replace(/\D/g,'')"/>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 计量方式 -->
                                        <div class="am-form-group">
                                            <label class="am-u-sm-3 am-form-label">计量方式</label>
                                            <div class="am-u-sm-7"  />
                                                <select id="measureWay" data-am-selected="{searchBox: 0}" style="display: none;" required="required" >
                                                    <option value="1">包</option>
                                                    <option value="2">克</option>
                                                </select>
                                            </div>
                                            <div class="am-u-sm-2">
                                                <small>必填！</small>
                                            </div>
                                        </div>

                                        <!-- 按钮 -->
                                        <div class="am-form-group">
                                            <span class="am-u-sm-3">
                                            </span>
                                            <div class="am-u-sm-6 am-u-sm-push-3">
                                                <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success am-u-sm-5" data-am-modal-close="">取消</button>
                                                <span class="am-u-sm-2">
                                                </span>
                                                <button type="submit" href="javascript: void(0)" id="form_submit" class="am-btn am-btn-primary tpl-btn-bg-color-success am-u-sm-5" data-am-modal-close>提交</button>
                                            </div>
                                            <span class="am-u-sm-3">
                                            </span>
                                        </div>

                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 整个表单结束 -->
                </div>
            </div>
        </div>
        <!-- 添加分店模态框结束 -->
    

    <script src="assets/js/amazeui.min.js"></script>
    <script src="assets/js/amazeui.datatables.min.js"></script>
    <script src="assets/js/dataTables.responsive.min.js"></script>
    <script src="assets/js/app.js"></script>
<script>
$("#form_submit").on("click",function(){
    if($("#product_no").val() == "" || $("#ingre").val() == "" ||$("#proEffect").val() == "" || $("#useOf").val() == "" || $("#purchasePrice").val() == "" || $("#unitPrice").val() == "" || $("#proStock").val() == "" ){
        alert("请输入完整信息");
        return false;
    }
    var windowURL = window.URL || window.webkitURL;
    var file = document.getElementById('proPhoto').files[0];
    if (file){
        var loadImg = windowURL.createObjectURL(file);
        document.getElementById('oldImg').setAttribute('src',loadImg);
    }else{
        alert("请选择一张商品图片！");
        return false;
    }
    var proType_id = $("#proType_id option:selected").html();
    var product_no = $("#product_no").val();
    var ingre = $("#ingre").val();
    var proEffect = $("#proEffect").val();
    var useOf = $("#useOf").val();
    var proInstruct = $("#proInstruct").val();
    var purchasePrice = $("#purchasePrice").val();
    var unitPrice = $("#unitPrice").val();
    var proStock = $("#proStock").val();
    var measureWay = $("#measureWay option:selected").html();
    var product_enter = {
        "proType_id":proType_id,
        "product_no":product_no,
        "ingre":ingre,
        "proEffect":proEffect,
        "useOf":useOf,
        "proInstruct":proInstruct,
        "proPhoto":loadImg,
        "purchasePrice":purchasePrice,
        "unitPrice":unitPrice,
        "proStock":proStock,
        "measureWay":measureWay
    };

    console.table(product_enter);
});
</script>

<script language="JavaScript" >
function onlyNumber(obj){
//先把非数字的都替换掉，除了数字和. 
obj.value = obj.value.replace(/[^\d\.]/g,''); 
//必须保证第一个为数字而不是. 
obj.value = obj.value.replace(/^\./g,''); 
//保证只有出现一个.而没有多个. 
obj.value = obj.value.replace(/\.{2,}/g,'.'); 
//保证.只出现一次，而不能出现两次以上 
obj.value = obj.value.replace('.','$#$').replace(/\./g,'').replace('$#$','.');
}
</script>
</body>

</html>